AN ABSOLUTE BEGINNER'S GUIDE TO BUILDING GRWIN PGPLOT FOR WINDOWS WITH
VISUAL FORTRAN

These instructions are for building pgplot with the Visual Fortran
IDE. Since presumably many people will be trying to do this who are
used to a command-line environment, I'm going to give these
instructions at a really ridiculously low tutorial level. Before
building pgplot you will need to obtain the (excellent) GrWin library
from:

http://spdg1.sci.shizuoka.ac.jp/grwinlib/english


(1) Copy files from original PGPLOT distribution to a folder named
    "pgplot". This folder contains folders named "applications",
    "cpg", "drivers", etc etc. We will leave the files in here
    untouched.

(2) Start the Digital Visual Fortran integrated development
    environment. Make sure the build toolbar is shown by right
    clicking on the menu area and making sure that the "Build" box has
    a checkmark next to it.  Select File->New, select projects tab,
    select Fortran static library. In project name box type
    "MyPGPLOT", and in the Location box pick any convenient
    folder. Select OK.

(3) In the project workspace tree we will add files from the original
    pgplot distribution. Right click on "MyPGPLOT Files" and select
    "Add Files to Project". Browse to the /src directory in the
    original pgplot distribution, and in the "Files of type" pull-down
    box select "All files.". In the file window select the first file
    in the list. Then hit CTRL-A to select all remaning files. Hit OK.

(4) Add the grsy00.f file from the "sys_win" directory to the project.

(5) Decide which drivers you want. These instructions are for building
    the postscript drivers and the grwin driver. If you want a
    different set of drivers you'll have to (a) include separate
    driver files from those listed below, and (b) hack the grexec.f
    file by hand (see next step). Assuming you want to drivers I want,
    then Repeat the step above to add more files from the original
    pgplot distribution. Add "nudriv.f" and "psdriv.f" from the
    /drivers directory in the original pgplot distribution to the
    project.  These are the null driver and postscript driver,
    respectively. We will add the grwin driver in the next step, along
    with a few other files.

(6) Add the files grexec.f, grdos.f, and grgfil.f and gwdriv.c from
    the same folder in which you got these instructions.  the hacked
    version of the grwin distribution.

(7) Build the project using the build menu or just hit F7. This will
    build a static library called MyPGPLOT.lib in a subfolder called
    Debug.

(8) Assuming the project has built successfully, we're now going to to
    build the font information file needed by PGPLOT. Right click on
    "Workspace 'MyPGPLOT'" in the project workspace tree and select
    "Add new project into workspace"

(9) Add a fortran console application called pgpack to the
    workspace. Add the pgpack.f file located in the "fonts"
    subdirectory of the pgplot distribution to this file. Build the
    pgpack program. You now need to do some stuff from the command
    line. Copy the grfont.txt file to the directory with the
    pgpack.exe executible and run pgpack as follows:

    pgpack <grfont.txt

    This creates a file grfont.dat which you should move to a folder
    specified by the environment variable PGPLOT_DIR. Make sure you
    use forward slashes instead of backslashes in the folder
    path. Spaces in the folder name are OK.

(10) Test the distribution by building the demo programs. For example,
     to build the first demo add a fortran console application called
     pgdemo1 to the workspace. Add a new project to the the workspace
     by right clicking on the top branch of the worspace tree again
     and selecting "Add a new project to the workspace". Now right
     click on this project and add the file pgdemo1.f from the
     "examples" folder in the pgplot distribution. Also add the pgplot
     library MyPGPLOT.lib you just built, and the GrWin.lib library
     file. Build the project by hitting F7.


(12) Everything you've built so far has debug code built in and is
     slower than it needs to be. To build a final version of the
     library go back to the library project and select "Release" from
     the build toolbar and rebuild everything.  This will create a
     library in the Release folder that is lean and mean.

(13) Follow the instructions in the file aaaread.me2 in the sys_win
     subdirectory of the PGPLOT folder to make the cpgplot bindings
     and cpgplot.lib

(14) Test the CPGPLOT bindings by building cpgdemo. To do this add a
     new Win32 console project to the workspace. Add cpgdemo.c to the
     project. Link against cpgplot.lib and the pgplot library you
     created earlier.


